# installer php7 et mongo 3.6 pour dev sur ubuntu prérequis avoir d'installer git, docker et docker-compose ### install docker choose community edition CE https://docs.docker.com/engine/installation/ **example install docker ubuntu** https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/ **Post-installation steps for Linux** https://docs.docker.com/engine/installation/linux/linux-postinstall/ ### install docker-compose https://docs.docker.com/compose/install/ ### install start complete docker apache php7 auto script (ubuntu,docker,docker-compose,git,unzip) installer sur la machine : ubuntu,docker,docker-compose,git,unzip ## install start complete docker apache php7 ### clone du repo docker créer un repertoire à la racine de votre user et cloner le repo docker ```bash git clone https://gitlab.adullact.net/pixelhumain/docker.git ~/pixelhumain-php7/ cd ~/pixelhumain-php7/ ``` changer de branch pour php7 ```bash git checkout php7 ``` ### build les services front (apache php7) et mongo (3.6) créer le repertoire code/ dans le repertoire ~/pixelhumain-php7/ ```sh mkdir ~/pixelhumain-php7/code/ ``` cette commande build le container pour le front à partir du dossier docker-front-apache ```sh docker-compose -f docker-compose-apache.yml build ``` ### clone des différents repo Depuis le repertoire mkdir ~/pixelhumain-php7/code/ vous pouver cloner les différents repo ```sh cd ~/pixelhumain-php7/code/ git clone https://gitlab.adullact.net/pixelhumain/pixelhumain.git pixelhumain ``` modules ```sh mkdir modules cd modules git clone https://gitlab.adullact.net/pixelhumain/communecter.git communecter git clone https://gitlab.adullact.net/pixelhumain/citizenToolkit.git citizenToolKit git clone https://gitlab.adullact.net/pixelhumain/co2.git co2 git clone https://gitlab.adullact.net/pixelhumain/api.git api git clone https://gitlab.adullact.net/pixelhumain/dda.git dda git clone https://gitlab.adullact.net/pixelhumain/news.git news git clone https://gitlab.adullact.net/pixelhumain/interop.git interop git clone https://gitlab.adullact.net/pixelhumain/graph.git graph git clone https://gitlab.adullact.net/pixelhumain/eco.git eco git clone https://gitlab.adullact.net/pixelhumain/chat.git chat git clone https://gitlab.adullact.net/pixelhumain/survey.git survey git clone https://gitlab.adullact.net/pixelhumain/map.git map git clone https://gitlab.adullact.net/pixelhumain/places.git places git clone https://gitlab.adullact.net/pixelhumain/cotools.git cotools git clone https://gitlab.adullact.net/pixelhumain/costum.git costum ``` ### lancer composer depuis docker-compose ```sh cd ~/pixelhumain-php7/ ``` lancer les services ```sh docker-compose -f docker-compose-apache.yml up -d ``` lancer sur le service front la commande pour installer les packages depuis composer ```sh docker-compose -f docker-compose-apache.yml exec front composer config -g "secure-http" false -d /code/pixelhumain/ph docker-compose -f docker-compose-apache.yml exec front composer install -d /code/pixelhumain/ph ``` ### config mongo dans ~/pixelhumain-php7/code/pixelhumain/dbconfig.php ```sh cat > ~/pixelhumain-php7/code/pixelhumain/ph/protected/config/dbconfig.php < 'mongoYii.EMongoClient', 'server' => 'mongodb://mongo:27017/', 'db' => 'pixelhumain', ); \$dbconfigtest = array( 'class' => 'mongoYii.EMongoClient', 'server' => 'mongodb://mongo:27017/', 'db' => 'pixelhumaintest', ); EOF ``` création repertoire et droit en ecriture ``` docker-compose -f docker-compose-apache.yml exec front mkdir -vp /code/pixelhumain/ph/{assets,upload,protected/runtime} docker-compose -f docker-compose-apache.yml exec front chmod -R 777 /code/pixelhumain/ph/assets docker-compose -f docker-compose-apache.yml exec front chmod -R 777 /code/pixelhumain/ph/upload docker-compose -f docker-compose-apache.yml exec front chmod -R 777 /code/pixelhumain/ph/protected/runtime ``` ### mongo data ```sh docker-compose -f docker-compose-apache.yml exec -T mongo mongo mongo/pixelhumain <